package com.abi${classpath}.controller;

import com.abi.infrastructure.core.api.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * ${controllerDesc}
 * </p>
 *
 * @author Andy.Tan
 */
@Slf4j
@RestController
@Api(tags = "${controllerDesc}")
public class ${controllerName_Iii}Controller {

    @Autowired
    private ${controllerName_Iii}Service ${controllerName_iii}Service;

<#list methodList as temp>
    @ApiOperation("${temp.t0_iii}")
    <#if temp.t1_iii=="get">@GetMapping("${temp.t3_iii}")<#else>@PostMapping("${temp.t3_iii}")</#if>
    public ApiResponse<#if temp.t1_iii=="get"><${temp.t2_Iii}Res></#if> ${temp.t2_iii}(@Validated <#if temp.t1_iii=="get"><#else>@RequestBody </#if>${temp.t2_Iii}Req ${temp.t2_iii}Req) throws Exception{
        //${temp.t0_iii}
        <#if temp.t1_iii=="get">${temp.t2_Iii}Res result = <#else></#if>${controllerName_iii}Service.${temp.t2_iii}(${temp.t2_iii}Req);
        //包装出参
        return ApiResponse.result(<#if temp.t1_iii=="get">result</#if>);
    }

</#list>


}








